import axios from 'axios';

//获取商品类型
export const getGoodTypes = (data) => {
  return axios({
    url: `/api/gen/goodstype?${data}`,
    method: 'GET',
    data,
  });
};
//添加商品类型数据
export const addGoodType = (data) => {
  return axios({
    url: '/api/gen/goodstype/',
    method: 'POST',
    data,
  });
};
//删除商品类型数据
export const delGoodType = (data) => {
  return axios({
    url: `/api/gen/goodstype/${data}`,
    method: 'DELETE',
    data,
  });
};
//修改商品类型数据
export const updataGoodType = (data) => {
  console.log(data);
  return axios({
    url: '/api/gen/goodstype',
    method: 'Put',
    data,
  });
};

//获取商品数据
export const getGoods = (data) => {
  return axios({
    url: `/api/gen/goods/?${data}`,
    method: 'GET',
    data,
  });
};
//添加商品数据
export const addGoods = (data) => {
  console.log(data);
  return axios({
    url: '/api/gen/goods',
    method: 'POST',
    data,
  });
};
//删除商品数据
export const delGood = (data) => {
  console.log(data);
  return axios({
    url: `/api/gen/goods/${data}`,
    method: 'DELETE',
    data,
  });
};
